home *** CD-ROM | disk | FTP | other *** search
- PSET in dBASE
- (PC Magazine Vol 5 No 16 Sept 30, 1986 Power User)
-
- PSET.COM (PC Magazine Vol 5 No 8 April 29, 1986 Power User) is
- translated into dBASE. PSET.PRG can be called from the dot prompt or
- directly from a program, and the syntax is the same as for PSET.COM,
- with one exception: in dBASE, the control codes are passed as a
- parameter, so they must be enclosed in quotes. For example, the
- sequence ESC E ESC G sets an Epson to print double-strike/emphasized.
- To send this command in dBASE, you use:
-
- . do pset with "27 69 27 71"
-
- The control codes are accepted by the printer without moving the
- printhead, so you can change type sizes or enhancements on the same
- print line -- up to dBASE's built-in limitation of 264 characters per
- command line. The CONSOLE is SET OFF so the proceedings don't muddle
- up your screen with that screwball crew of characters under CHR(32)!
- Editor's Note: It's handier to call PSET.PRG than to RUN PSET.COM
- even if you have the memory available. It's faster, too. The line
- "pset=incoming" was added, so the incoming parameter doesn't get eaten
- in the DO WHILE loop. So, for example, you could:
-
- . STOR "27 69 27 71" to dublbold
- . DO PSET WITH dublbold
-
- Notice that if you're passing a memory variable as the parameter,
- don't enclose it in quotes. If you do, PSET will dutifully shout
- CHR(dublbold) at your printer and -- worse -- your printer will hear!
- There's a lot you can build onto PSET if you want to. You could
- STORE complete sets of parameters at the beginning of a program or in
- a procedure file. Or you could save them in a .MEM file, RESTORing
- them as needed. This is useful if you often switch between printers.
-
- *** PSET.PRG - Sends control codes to a printer
- PRIV incoming,pset,loc,seg
- PARA incoming
- SET CONS OFF
- pset=incoming
- DO WHIL " "$pset
- loc=AT(" ",pset)
- seg="CHR("+SUBS(pset,1,loc-1)+")"
- SET PRIN ON
- ?? &seg
- SET PRIN OFF
- pset=SUBS(pset,loc+1)
- ENDDO
- seg="CHR("+pset+")"
- SET PRIN ON
- ?? &seg
- SET PRIN OFF
- SET CONS ON
- RETU
- * Incoming parameter uses the space as delimiter
- * Printer must be online
-